package com.eight.controller.api;

import com.eight.service.UserService;
import com.eight.vo.ComResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/system/api/user")
public class UserApi {
    /*注入user业务层*/
    @Autowired
    private UserService userService;

    /**
     *
     * @return
     */
    @RequestMapping("getUserNumber")
    public ComResult getUserNumber() {
        return new ComResult(2000, "查询到使用人员个数", userService.getUserNumber());
    }

    /**
     * 查询所有的使用用户的数量用来制作图表
     * @return 返回使用的人数
     */
    @RequestMapping("getUserChart")
    public ComResult getUserChart() {
        return new ComResult(2000, "查询到使用人员个数", userService.getUserList());
    }

}
